package C;

import java.util.Arrays;
import java.util.Scanner;

public class C54 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] nums = Arrays.stream(sc.nextLine().split(",")).mapToInt(Integer::parseInt).toArray();
        System.out.println(getResult(nums));
    }

    public static int getResult(int[] nums) {
        if (nums.length==1) return 1;
        int countPeeks = 0;
        for (int i = 0; i < nums.length; i++) {
            if (i == 0 ) {
                if (nums[i] > nums[i + 1]){
                countPeeks++;
                }
            } else if (i == nums.length - 1 ) {
                if (nums[i] > nums[i - 1]) {
                    countPeeks++;
                }
            } else  {
                if (nums[i] > nums[i - 1] && nums[i] > nums[i + 1]) {
                    countPeeks++;
                }
            }
        }

        return countPeeks;
    }
}
